package com.zdsoft.blp.zongbuju.wode.activity;

import android.content.Intent;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import com.zdsoft.blp.R;
import com.zdsoft.blp.gongyong.fanhui.FanHuiView;
import com.zdsoft.blp.gongyong.net.BaseActivity;

/**
 * Created by Administrator on 2016/9/1.
 */
public class XiuGaiNiChengActivity extends BaseActivity {

    private FanHuiView back;
    private Button bt_tijiao;
    private EditText et_name;

    @Override
    protected void init() {
        setContentView(R.layout.xiugainicheng_wode);
        bt_tijiao = find(R.id.bt_tijiao);
        back = find(R.id.back);
        et_name=find(R.id.et_name);
        back.getTv_title().setText("修改昵称");
        final Intent intent=getIntent();
        final String nicheng=intent.getStringExtra("nicheng");
        et_name.setText(nicheng);
        bt_tijiao.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                String name=et_name.getText().toString().trim();
                intent.putExtra("name",name);
                setResult(RESULT_OK,intent);
                if (!nicheng.equals(name)){
                    finish();
                }

            }
        });

    }
}
